UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yIUT7I1PursB/ezQixy0VnAtk5Dje1CX3lOr6KjRSkU=' 
WHERE 
  key_id = 'dd55147764c14a0c2dc9d8bc1a29b8238faea7fa3b7826adc7660283a55cfa95' 
  AND (
    token = 'yIUT7I1PursB/ezQixy0VnAtk5Dje1CX3lOr6KjRSkU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041