UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hB0LQ34XDxy1C9azbx3C7aNbVbJ83/rP5lRkT9U6qxM='
WHERE
key_id = '533522432f34ee377f79442578904393d6517dedc4c976bb9c3a089a8f2b292d'
AND (
token = 'hB0LQ34XDxy1C9azbx3C7aNbVbJ83/rP5lRkT9U6qxM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)