UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3IkfYDedlL3m8rHyTgxzYyAmnTqqsJeRvpRULoKvsGM='
WHERE
key_id = '38db642e57fb99d82da85f909d0b5cdb144c8601c58ed6c76bc8700b33f1bc31'
AND (
token = '3IkfYDedlL3m8rHyTgxzYyAmnTqqsJeRvpRULoKvsGM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)