UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L9Cr9npFHuoMmr9KoqBcZIn78wLxQd08E3gS/9OnZ1o='
WHERE
key_id = 'b4688e86e2275c4a782ec287e1518d8ed89b059ecb43b465195ea30231df5f0c'
AND (
token = 'L9Cr9npFHuoMmr9KoqBcZIn78wLxQd08E3gS/9OnZ1o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)