UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IcRJLq3dVgpMTm9bEiUkS0Uk30GQ9DKeRihGQ7ry56s=' 
WHERE 
  key_id = '943fa23a5ecd0dcf7e058c1ec29dd04302c14a0a38ab0db813286f4f318f342d' 
  AND (
    token = 'IcRJLq3dVgpMTm9bEiUkS0Uk30GQ9DKeRihGQ7ry56s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037