UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p2n1pFiFXDE4rErSIo1ufn08L8yRldC+lGpYkmS/HE8='
WHERE
key_id = '343ed6c10b5fd8380e0bdffa4b6b00377270a68b0543b239bb0487d50abf53d9'
AND (
token = 'p2n1pFiFXDE4rErSIo1ufn08L8yRldC+lGpYkmS/HE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)