UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RFEwLF6crds4jfWaCcdkzd/o4z3gCpzrzKwhOQy4VNk=' 
WHERE 
  key_id = '0591ccb5665122398eebede16ede720c76417e2a93eba92eca52aa6db242c45e' 
  AND (
    token = 'RFEwLF6crds4jfWaCcdkzd/o4z3gCpzrzKwhOQy4VNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069