UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EV3X4z8fvMiulpBNJWaLQiK21va5KwcYBLHQZ6amjh4=' 
WHERE 
  key_id = '0212a1a9716e7ce33a854213ed5f8954b4645e1722f923dbf146be4fd238938b' 
  AND (
    token = 'EV3X4z8fvMiulpBNJWaLQiK21va5KwcYBLHQZ6amjh4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030