UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'soZcGKmvsN43VEPlMV1yFTYinyqhTSeUKWdBeYGek2A='
WHERE
key_id = '381af2f1050cbbe024b05782dc35fe74e68d1de545f7599c188dc9f67521c760'
AND (
token = 'soZcGKmvsN43VEPlMV1yFTYinyqhTSeUKWdBeYGek2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)