UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WKgV5ZYSSuD0AQPdtHS5q2HL0wmy/wsHwJglKA4kwAQ=' 
WHERE 
  key_id = '89333b7cc2f1315d2fed5a460ade388a9659a9181b2a549214299aa71946f066' 
  AND (
    token = 'WKgV5ZYSSuD0AQPdtHS5q2HL0wmy/wsHwJglKA4kwAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021