UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YvY5g+5xRdSWi97aMN2iMmyY9rd0wSGoN0i0Nn1Qd0I=' 
WHERE 
  key_id = 'a43ca9e79b307a78b8721328ff0e73931710bd6f5ec77f72bda0e6b092ae6962' 
  AND (
    token = 'YvY5g+5xRdSWi97aMN2iMmyY9rd0wSGoN0i0Nn1Qd0I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031