UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j4Q4pxPI/EzMj1jo7SUKcRQvl5U99U5RUUztIRgl6Jg=' 
WHERE 
  key_id = 'b5c79629c2afe94cea06d7638eb3ae939da25dc137d931c31b8c548f7eed41e6' 
  AND (
    token = 'j4Q4pxPI/EzMj1jo7SUKcRQvl5U99U5RUUztIRgl6Jg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030