UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm/68jZLZnhmWGUOwd1SBo2dEGvpgXeJ+lyZcn4/b6UU=' 
WHERE 
  key_id = '3d2e909905d726bd6ca6e3035772d2af27523574e54940c721a6296838546617' 
  AND (
    token = 'm/68jZLZnhmWGUOwd1SBo2dEGvpgXeJ+lyZcn4/b6UU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039