UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D6zXsf0yyJaQC1u1PjiN7MHq4cxKOT1LGAXRAMrw0r0=' 
WHERE 
  key_id = '27c5e04a083a64f55bb6b7325ee4721dd4d4fd60fea97b4cbd4a1c89134c5ef8' 
  AND (
    token = 'D6zXsf0yyJaQC1u1PjiN7MHq4cxKOT1LGAXRAMrw0r0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029