UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pbGhU3sCdK/A0x7j5jOUUnpdcMLO3srHhTflyWp9OCM='
WHERE
key_id = '3408218e0924e587ebdb8ddc9a5bb1c4094d20e60d54a05a6d4a774a0704a625'
AND (
token = 'pbGhU3sCdK/A0x7j5jOUUnpdcMLO3srHhTflyWp9OCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)