UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LUrTz4QB34iHJPqu1zEcIfMXbP4o1Kf46MAEOhqlYr8='
WHERE
key_id = '4191b0b778c8e3113010b11edc3dd941b4bf7400580aa56b9f50c16ced9c3463'
AND (
token = 'LUrTz4QB34iHJPqu1zEcIfMXbP4o1Kf46MAEOhqlYr8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)