UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hy7HfdVLYD6olJZ++RPOeP5jz3H7NtVfJDOX0Z8JLO4='
WHERE
key_id = 'c817a893410dd1d334edf5b08211dfe133f95740441fb1ade46afc10486f1a13'
AND (
token = 'hy7HfdVLYD6olJZ++RPOeP5jz3H7NtVfJDOX0Z8JLO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)