UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yg5Nhbmm40tOClycbfcYQJHzdkNLUX06NxRvaeQYQMc='
WHERE
key_id = '444ede0351c8002f9dd5cac2c56772bec71e3bdb62fcbe4ada765a768b547dd8'
AND (
token = 'Yg5Nhbmm40tOClycbfcYQJHzdkNLUX06NxRvaeQYQMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)