UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+YFTr3d2eNLZfjBRvq4C9BUYP1BrYduhW4474IKlnj0='
WHERE
key_id = '3bd203210296a974a71afc9328a6b6a4bc97ffffce1186b225af10b1a9708f98'
AND (
token = '+YFTr3d2eNLZfjBRvq4C9BUYP1BrYduhW4474IKlnj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)