UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wmd4DeVtzMVM6szzZ8GjK5pQAg7kfk89d1TdwgVkWi4='
WHERE
key_id = '6a91f488519a28588eba713da4661153cb01f09f08036c65d594ae06fed9ffdc'
AND (
token = 'wmd4DeVtzMVM6szzZ8GjK5pQAg7kfk89d1TdwgVkWi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)