UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GL2lGMjlmWkmlK7GfcWhfhEV4B4cR2oU/azhMe3QcBY='
WHERE
key_id = 'd6f5502404cac1718e22b8edaab221c1e764ecf09442d2f0c9fc11af85ff212a'
AND (
token = 'GL2lGMjlmWkmlK7GfcWhfhEV4B4cR2oU/azhMe3QcBY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)