UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5C/LtqihD2Afra9y5/Fkh+rEIUh9G+9L9iRJPjZPs0Y='
WHERE
key_id = '828a8017b32f3c26a635f23752f138a48e3585501f284e9eff3d84672ae07ae4'
AND (
token = '5C/LtqihD2Afra9y5/Fkh+rEIUh9G+9L9iRJPjZPs0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)