UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vTmqONPolAg42ftNUnvu7hj3uu+9r+6ZKYTe3fN6bb4=' 
WHERE 
  key_id = '1d76a43d363e243cfd96f069d61258b1445c2441d3f97bcffbb941a8055ce22f' 
  AND (
    token = 'vTmqONPolAg42ftNUnvu7hj3uu+9r+6ZKYTe3fN6bb4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028