UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dv5Xn1sLqEOq82T0xkhpcTiN30mlCEyUSGSsQpYHqOs='
WHERE
key_id = '1786211a5aed28ef170833cac0b17a6244cebeeef7f32ea7f093840c5a46827e'
AND (
token = 'Dv5Xn1sLqEOq82T0xkhpcTiN30mlCEyUSGSsQpYHqOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)