UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hEYXEeQ31AvAuzqq9IWtzdnGQD1fb98ymf0/wbB8Nyw='
WHERE
key_id = '5f843056b4af034de58b839368bf45ea9a6735ccb6358b4dd1a0f35e0d57f93c'
AND (
token = 'hEYXEeQ31AvAuzqq9IWtzdnGQD1fb98ymf0/wbB8Nyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)