UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4ojKi4WKhjliAuvcYYyEXU/H1Ro+cwzJi6XqVZynfSA=' 
WHERE 
  key_id = '0d20eeff52aa2f8797585b4fac6d60fe8f900d878bd36f02696c67478162f682' 
  AND (
    token = '4ojKi4WKhjliAuvcYYyEXU/H1Ro+cwzJi6XqVZynfSA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040