UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1KBLbSRndHfwqBUGPEM+udppksYSQbRBL0MLrG1PSo0='
WHERE
key_id = '636a803b5cac9d9aeea1d22d1787f0213b8496ca144474bc527e5dbb5dab9e48'
AND (
token = '1KBLbSRndHfwqBUGPEM+udppksYSQbRBL0MLrG1PSo0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)