UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PkJRmjtzQ8fgcVt4G4/t8j+OjpTkRw2pZRAvnebR+jo='
WHERE
key_id = '4df96d88e0bb2d1ef66b05a02b351dc5629e1c9a1cdb2bfb204916772a2719e7'
AND (
token = 'PkJRmjtzQ8fgcVt4G4/t8j+OjpTkRw2pZRAvnebR+jo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)