UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GV3STXumXAtveTagpwWQYNSCaFQz9zd1acDiioUZn40='
WHERE
key_id = 'd2e5313aa395879bc0d3925db3a1ce23c127ada656102ad26b3a8dd046873cbd'
AND (
token = 'GV3STXumXAtveTagpwWQYNSCaFQz9zd1acDiioUZn40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)