UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GdZXVvb17HcNkPNWNH82dr/p8NdTEWPb1zJUUhu0EuI='
WHERE
key_id = 'ed85678175255f4cdfd898c30718cb77fba1e1b7979df3cd98bf75529db6d3e2'
AND (
token = 'GdZXVvb17HcNkPNWNH82dr/p8NdTEWPb1zJUUhu0EuI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)