UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LXNusOKfG1lEPLAW8N209NJBtM/7kZ7UE7x4Lnw8i6g=' 
WHERE 
  key_id = '2fb76eb997bc7028d5a803a2825742a2966f61cedb19348dba041c2851e87f7a' 
  AND (
    token = 'LXNusOKfG1lEPLAW8N209NJBtM/7kZ7UE7x4Lnw8i6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033