UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XqsVX0K31PbU0s+JOKO1ttZmUWd+UkaF9fQF4oaBSFA=' 
WHERE 
  key_id = '0a8cf0bb38b16b324fb3a7f18cbfe51b61a5ccefe40758859b4a5ec597b2da6c' 
  AND (
    token = 'XqsVX0K31PbU0s+JOKO1ttZmUWd+UkaF9fQF4oaBSFA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027