UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's91JXBokpniZMTmp18Zd7lk3mGdqeWOwVJ20Fz3Z/dg='
WHERE
key_id = '7c13ba85316f4851591cd0e3e9f56de028533257ea811931c29868f403d663b3'
AND (
token = 's91JXBokpniZMTmp18Zd7lk3mGdqeWOwVJ20Fz3Z/dg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)